package com.wrupple.vegetate.server.domain;

import java.util.Collection;
import java.util.HashMap;

import com.google.inject.Provider;
import com.wrupple.vegetate.server.VegetateServiceLocator;
import com.wrupple.vegetate.server.integration.HttpServletRequestHandler;

public class UnmutableModuleMap extends HashMap<String, Provider<? extends HttpServletRequestHandler>> implements RootTokenMapper {
	private static final long serialVersionUID = 9021792031558022220L;

	@Override
	public Provider<? extends HttpServletRequestHandler> put(String key,
			Provider<? extends HttpServletRequestHandler> value) {
		if(key!=null && containsKey(key)){
			throw new IllegalArgumentException("Service key "+key+" has already been bound");
		}
		return super.put(key, value);
	}

	@Override
	public Collection<VegetateServiceLocator> getChildren() {
		//TODO 
		return null;
	}

}
